package com.ruge.gateway.error;

import com.ruge.core.exception.IError;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @program: ruge-cloud
 * @description:
 * @author: ruge.wu
 * @create: 2022-01-08 19:46
 **/
@NoArgsConstructor
@AllArgsConstructor
public enum ApiGatewayError implements IError {
    TOKEN_NOT_FOND("0001", "token 不存在 （未传递token）"),
    UNKNOWN_TOKEN_ERROR("0002", "token 认证失败（token校验失败）"),
    ;

    private String errorCode;
    private String errorMessage;
    private static final String NAME_SPACE = "GATE-WAY-ERROR";

    @Override
    public String getNamespace() {
        return NAME_SPACE;
    }

    @Override
    public String getErrorCode() {
        return NAME_SPACE + "." + errorCode;
    }

    @Override
    public String getErrorMessage() {
        return errorMessage;
    }
}
